package cn.sdormitory.basedata.dao;

import cn.sdormitory.basedata.entity.BClass;
import cn.sdormitory.basedata.vo.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @创建人：zhouyang
 * @创建时间：2020/11/2 17:17
 * @version：V1.0
 */
@Mapper
@Component
public interface BClassDao  extends BaseMapper<BClass> {
    List<BClass> getBClassList(@Param("className")String className, @Param("status")String status,@Param("classTeacherName")String classTeacherName,@Param("classDept")String classDept,@Param("classType")String classType,@Param("currIndex")int currIndex,@Param("pageSize")int pageSize);

    List<BClassVo> getAppClassListByTeaId(@Param("loginId")Long loginId);

    List<BClassStudentVo> getAppClassStuListByCName(@Param("className")String className);

    List<BClassDorVo> getAppClassDorListByTeaId(@Param("classTeacherId")Long classTeacherId);

    List<BClassDorAndHyVo> getClassDorAndHyListByTeaId(@Param("classTeacherId")Long classTeacherId);

    Long getStuCountByClaId(@Param("classId")Long classId);

    List<ClassDeptVo> getAppClassDept();

    List<BClassVo> getAppClassDeptByClaId(@Param("classDeptId")Long classDeptId);

    List<BClassVo> getAppClassByDeptIds(@Param("deptIds") Collection<Long> deptIds);

    List<BClassDeptVo> getAppClassDeptAccDvByDeptId(@Param("accessDate")String accessDate,@Param("classDeptId")Long classDeptId,@Param("timeSlot")String timeSlot);

    List<BClassDeptHyVo> getAppClassDeptHyByDeptId(@Param("accessDate")String accessDate,@Param("classDeptId")Long classDeptId,@Param("timeSlot")String timeSlot);

    List<BClassDeptReVo> getAppClassDeptReByDeptId(@Param("classDeptId")Long classDeptId);

    List<BClassVo> getAllAppClassList();

    List<BClassStudentVo> getClassStuListByClassId(@Param("classId")String classId);

    List<BClassStudentVo>getClassStuListAllByClassId(@Param("classId")String classId);

    int getBoardingStuCountByClassId(@Param("classId")String classId);

    Integer getLeaveStuCountByClassId(@Param("classId")String classId,@Param("queryDate")String queryDate);

    List<BClass> getAllClass();

    BClass getClassInfoByClassId(@Param("classId")Long classId);

//    /**
//     * 根据班级id和日期查询班级考勤
//     * @param clsId
//     * @param assessDate
//     * @return
//     */
//    List<ClassAttence> getClsAttenceByClsIdAndDate(Long clsId, String assessDate);
    String getClassIdByClassName(String classname);
    List<BStudentListVo> getStudentListByClassId(int classId);
    int updateStudent(@Param("id")int id,@Param("studentName")String studentName,@Param("studentPhone")String studentPhone,@Param("parentPhone")String parentPhone);
    int upStuOpenId(@Param("name")String name,@Param("phone")String phone,@Param("openId")String openId);
    int upJiaOpenId(@Param("name")String name,@Param("stuPhone")String stuPhone,@Param("parentPhone")String parentPhone,@Param("openId")String openId);
    int upTeacharOpenId(@Param("access")String access,@Param("openId")String openId);

    /**
     * 根据部门id获取到班级id
     * @author alex
     * @param: deptId
     * @date 2024/10/16 11:08
     * @return
     */
    List<BClassVo> getClassListByDeptId(@Param("deptId") String deptId);

    List<Long> getDorIdsByClassId(Long classId);

    List<BClassVo> getBClassListByDeptGroup();
}
